package com.ruoyi.system.service.impl;

import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.NewarrivalMapper;
import com.ruoyi.system.domain.Newarrival;
import com.ruoyi.system.service.INewarrivalService;

/**
 * 新品上线配置Service业务层处理
 * 
 * @author zhang
 * @date 2025-07-24
 */
@Service
public class NewarrivalServiceImpl implements INewarrivalService 
{
    @Autowired
    private NewarrivalMapper newarrivalMapper;

    /**
     * 查询新品上线配置
     * 
     * @param newarrivalId 新品上线配置主键
     * @return 新品上线配置
     */
    @Override
    public Newarrival selectNewarrivalByNewarrivalId(Long newarrivalId)
    {
        return newarrivalMapper.selectNewarrivalByNewarrivalId(newarrivalId);
    }

    /**
     * 查询新品上线配置列表
     * 
     * @param newarrival 新品上线配置
     * @return 新品上线配置
     */
    @Override
    public List<Newarrival> selectNewarrivalList(Newarrival newarrival)
    {
        return newarrivalMapper.selectNewarrivalList(newarrival);
    }

    /**
     * 新增新品上线配置
     * 
     * @param newarrival 新品上线配置
     * @return 结果
     */
    @Override
    public int insertNewarrival(Newarrival newarrival)
    {
        newarrival.setNewarrivalAddtime(LocalDateTime.now());
        return newarrivalMapper.insertNewarrival(newarrival);
    }

    /**
     * 修改新品上线配置
     * 
     * @param newarrival 新品上线配置
     * @return 结果
     */
    @Override
    public int updateNewarrival(Newarrival newarrival)
    {
        return newarrivalMapper.updateNewarrival(newarrival);
    }

    /**
     * 批量删除新品上线配置
     * 
     * @param newarrivalIds 需要删除的新品上线配置主键
     * @return 结果
     */
    @Override
    public int deleteNewarrivalByNewarrivalIds(Long[] newarrivalIds)
    {
        return newarrivalMapper.deleteNewarrivalByNewarrivalIds(newarrivalIds);
    }

    /**
     * 删除新品上线配置信息
     * 
     * @param newarrivalId 新品上线配置主键
     * @return 结果
     */
    @Override
    public int deleteNewarrivalByNewarrivalId(Long newarrivalId)
    {
        return newarrivalMapper.deleteNewarrivalByNewarrivalId(newarrivalId);
    }
}
